package ru.spb.nicetu.schoolproject.gui;

import ru.spb.nicetu.schoolproject.TblModelForClasses;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * Created by dchernyshov on 01.04.15.
 */
public class ListOfClassesFrame extends CommonDialog<TblModelForClasses> {
    private JButton numberOfPupilsBtn;

    public ListOfClassesFrame(){
        super(new TblModelForClasses());
        setTitle("Классы");
        numberOfPupilsBtn = new JButton("Коk-во учеников по классам");
        numberOfPupilsBtn.addActionListener(new BtnNumberOfClassesListener());
        lastBox.add(Box.createHorizontalStrut(10));
        lastBox.add(numberOfPupilsBtn);
    }

    public class BtnNumberOfClassesListener implements ActionListener {
        @Override
        public void actionPerformed(ActionEvent actionEvent) {
            JDialog dialog = new NumberOfPupilFrame();
            dialog.setVisible(true);
        }
    }
}
